﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Jewelnoid
{
    class SpecialPower : AnimatedObject
    {
        public enum Power { Multiball, Unstoppable, StretchBar, ShrinkBar, LifeUp };
        static public Power[] powerUps = {Power.Multiball, Power.Unstoppable, Power.StretchBar, Power.LifeUp};
        static public Power[] powerDowns = {Power.ShrinkBar};

        public Power power;
        public Vector2 speed;

        public SpecialPower(Texture2D texture, Vector2 position, Power power) :
            base(texture, position, Color.White, new Vector2(90, 40), 1)
        {
            this.power = power;
            
            setPowerPosition(power);

            speed = new Vector2(0, 3); //velocidade de queda da imagem
        }

        public override void update(GameTime time)
        {
            this.position += speed;

            base.update(time);
        }

        public void setPowerPosition(Power power)
        {
            if (power == Power.StretchBar)
            {
                this.animation.Y = 0;
            }
            else if (power == Power.ShrinkBar)
            {
                this.animation.Y = 40;
            }
            else if (power == Power.Multiball)
            {
                this.animation.Y = 80;
            }
            else if (power == Power.Unstoppable)
            {
                this.animation.Y = 120;
            }
            else if (power == Power.LifeUp)
            {
                this.animation.Y = 160;
            }

            updateRect();
        }
    }
}
